﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Users/MasterPage.master" AutoEventWireup="true"
    CodeFile="RescheduleTicket.aspx.cs" Inherits="Users_RescheduleTicket" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h2 align="center">
        Reschedule Ticket</h2>
    <div style="background-color: #FFCC99">
        <b>Original Flight
            <br />
            <div style="background-color: #CC99FF">
                Find Similer Flight in the next&nbsp;
                <asp:DropDownList ID="ddlMonth" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlMonth_SelectedIndexChanged">
                    <asp:ListItem>0</asp:ListItem>
                    <asp:ListItem>1</asp:ListItem>
                    <asp:ListItem>2</asp:ListItem>
                    <asp:ListItem>3</asp:ListItem>
                    <asp:ListItem>4</asp:ListItem>
                    <asp:ListItem>5</asp:ListItem>
                    <asp:ListItem>6</asp:ListItem>
                    <asp:ListItem>7</asp:ListItem>
                    <asp:ListItem>8</asp:ListItem>
                    <asp:ListItem>9</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                </asp:DropDownList>
                &nbsp;month
            </div>
        </b>
        <div style="padding-left: 30px">
            <asp:DataList ID="DataList1" runat="server" Width="90%">
                <ItemTemplate>
                    FlightID:
                    <asp:Label ID="FlightIDLabel" runat="server" Text='<%# Eval("FlightID") %>' />
                    <br />
                    From:
                    <asp:Label ID="FromLabel" runat="server" Text='<%# Eval("Route.Origin.FullName") %>' />
                    <br />
                    To:
                    <asp:Label ID="ToLabel" runat="server" Text='<%# Eval("Route.Destination.FullName") %>' />
                    <br />
                    DepartTime:
                    <asp:Label ID="DepartTimeLabel" runat="server" Text='<%# Eval("DepartTime") %>' />
                    &nbsp;&nbsp;&nbsp;
                    <asp:Label ID="GMTLabel" runat="server" Text='<%# Eval("Route.Origin.GMT","GMT {0}") %>' />
                    <br />
                    Plane:
                    <asp:Label ID="PlaneLabel" runat="server" Text='<%# Eval("Plane.Name") %>' />
                    <br />
                    FlyHour:
                    <asp:Label ID="FlyHourLabel" runat="server" Text='<%# Eval("FlyHour") %>' />
                    <br />
                    <br />
                </ItemTemplate>
            </asp:DataList>
        </div>
    </div>
    <div align="center" style="width: 100%">
        <br />
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%">
            <Columns>
                <asp:BoundField DataField="FlightID" HeaderText="Flight ID" ReadOnly="True" SortExpression="FlightID">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                </asp:BoundField>
                <asp:BoundField DataField="DepartTime" DataFormatString="{0:t} {0:D}" HeaderText="Depart Time"
                    ReadOnly="True" SortExpression="DepartTime">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:BoundField>
                <asp:BoundField DataField="BussPrice" DataFormatString="{0} USD" HeaderText="Bussiness Class"
                    ReadOnly="True" SortExpression="BussPrice">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="FirstPrice" DataFormatString="{0} USD" HeaderText="First Class"
                    ReadOnly="True" SortExpression="FirstPrice">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                </asp:BoundField>
                <asp:BoundField DataField="ClubPrice" DataFormatString="{0} USD" HeaderText="Club Class"
                    ReadOnly="True" SortExpression="ClubPrice">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="80px" />
                </asp:BoundField>
                <asp:CheckBoxField DataField="Smoking" HeaderText="Smoking" ReadOnly="True" SortExpression="Smoking">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                </asp:CheckBoxField>
                <asp:BoundField DataField="FlyHour" DataFormatString="{0} Hour(s)" HeaderText="Fly Hour"
                    ReadOnly="True" SortExpression="FlyHour">
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                </asp:BoundField>
            </Columns>
            <EmptyDataTemplate>
                No match flight on this month
            </EmptyDataTemplate>
        </asp:GridView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="findSimilarFlight"
            TypeName="FlightBAL">
            <SelectParameters>
                <asp:Parameter Name="ticket" Type="Object" />
                <asp:Parameter Name="numofMonth" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
    <div style="width: 100%; background-color: #CC99FF;">
        <p style="margin-left: 40px">
            1 . Choose Flight
            <asp:DropDownList ID="ddlFlight" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlFlight_SelectedIndexChanged">
            </asp:DropDownList>
            <br />
            2 . Choose Seat Class
            <asp:DropDownList ID="ddlSeat" runat="server">
            </asp:DropDownList>
        </p>
    </div>
    <div align="center">
        <asp:Label ID="lblWarn" runat="server" Font-Bold="True" ForeColor="Red" Text="You can't reschedule this ticket"
            Visible="False"></asp:Label>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Confirm" OnClick="Button1_Click" />
    </div>
</asp:Content>
